package com.cskaoyan.controller.admin;

import com.cskaoyan.bean.common.BaseRespVo;
import com.cskaoyan.bean.common.CommonData;
import com.cskaoyan.bean.vo.admin.region.MarketRegionListVo;
import com.cskaoyan.service.admin.MarketRegionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 模块:商品管理/行政区域
 * uri: /admin/region
 *
 * @Author: zhang
 * @Date: 2022/11/19 15:58
 * @Since: jdk1.8
 */
@RestController
@RequestMapping("/admin/region")
public class MarketRegionController {
    @Autowired
    MarketRegionService regionService;

    /**
     * 查询所有省市区的信息
     * url:/admin/region/list
     *
     * @return data:MarketRegionVo
     */
    @RequestMapping("list")
    public BaseRespVo<CommonData<MarketRegionListVo>> list() {
        CommonData<MarketRegionListVo> commonData = regionService.list();
        return BaseRespVo.ok(commonData);
    }
}
